<script setup lang="ts">
import { toRefs } from "vue";
import _ from "lodash";
import assets from "@/utils/assets";
let props = defineProps(["checked"]);

let { checked } = toRefs(props);
let emit = defineEmits(["click"]);

let handleClick = () => {
  emit("click", !checked?.value);
};
</script>

<template>
  <div class="com-radio" @click="handleClick">
    <img :src="assets.radio_checked" v-if="checked" class="radio-img" />
    <img :src="assets.radio_default" v-else class="radio-img" />
  </div>
</template>

<style lang="less" scoped>
.com-radio {
  width: 48rpx;
  height: 48rpx;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
.radio-img {
  width: 48rpx;
  height: 48rpx;
}
</style>
